<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Demo</title>
  <!-- 请勿在项目正式环境中引用该 layui.css 地址 -->
  <link href="//unpkg.com/layui@2.10.0-rc.3/dist/css/layui.css" rel="stylesheet">
</head>
<body>
<div id="demo-laypage-hash"></div>
  
<!-- 请勿在项目正式环境中引用该 layui.js 地址 -->
<script src="//unpkg.com/layui@2.10.0-rc.3/dist/layui.js"></script>
<script>
layui.use(function(){
  var laypage = layui.laypage;
  // 开启 HASH
  laypage.render({
    elem: 'demo-laypage-hash',
    count: 500,
    curr: location.hash.replace('#!curr=', ''), // 初始获取 hash 值为 curr 的当前页
    hash: 'curr' // 自定义 hash 名称
  });
});
</script>
 
</body>
</html>